package com.dragon.modules.yuegou.query.act;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.act.OffPrizeEntity;
import com.dragon.modules.yuegou.enums.act.OffPrizeStatus;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 线下抽奖活动奖品表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-11-20 10:03:07
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class OffPrizeQuery extends OffPrizeEntity implements Query<OffPrizeEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 奖品级别查询条件 */
	@JsonUnwrapped(prefix = "grade")
	private Condition<String> gradeCondition;

    /** 名称查询条件 */
	@JsonUnwrapped(prefix = "name")
	private Condition<String> nameCondition;

    /** 数量查询条件 */
	@JsonUnwrapped(prefix = "sum")
	private Condition<Integer> sumCondition;

    /** 价值查询条件 */
	@JsonUnwrapped(prefix = "price")
	private Condition<BigDecimal> priceCondition;

    /** 图片地址查询条件 */
	@JsonUnwrapped(prefix = "img")
	private Condition<String> imgCondition;

    /** [枚举]奖品进行状态：0-未开始-NOT_STARTED、1-正在进行-ONGOING、2-已结束-OVER查询条件 */
	@JsonUnwrapped(prefix = "status")
	private Condition<OffPrizeStatus> statusCondition;

    /** 活动Id查询条件 */
	@JsonUnwrapped(prefix = "activityId")
	private Condition<String> activityIdCondition;

    /** 商品Id查询条件 */
	@JsonUnwrapped(prefix = "skuId")
	private Condition<String> skuIdCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "modifiedTime")
	private Condition<LocalDateTime> modifiedTimeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "modifiedBy")
	private Condition<String> modifiedByCondition;

    /** 删除 0-未删除；1-已删除查询条件 */
	@JsonUnwrapped(prefix = "del")
	private Condition<Boolean> delCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "delTime")
	private Condition<LocalDateTime> delTimeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "delBy")
	private Condition<String> delByCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public OffPrizeQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public OffPrizeQuery(OffPrizeEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public OffPrizeQuery(OffPrizeQuery other) {
		super(other);
		if (other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if (other.gradeCondition != null) {
			this.gradeCondition = other.gradeCondition.copy();
		}
		if (other.nameCondition != null) {
			this.nameCondition = other.nameCondition.copy();
		}
		if (other.sumCondition != null) {
			this.sumCondition = other.sumCondition.copy();
		}
		if (other.priceCondition != null) {
			this.priceCondition = other.priceCondition.copy();
		}
		if (other.imgCondition != null) {
			this.imgCondition = other.imgCondition.copy();
		}
		if (other.statusCondition != null) {
			this.statusCondition = other.statusCondition.copy();
		}
		if (other.activityIdCondition != null) {
			this.activityIdCondition = other.activityIdCondition.copy();
		}
		if (other.skuIdCondition != null) {
			this.skuIdCondition = other.skuIdCondition.copy();
		}
		if (other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if (other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
		if (other.modifiedTimeCondition != null) {
			this.modifiedTimeCondition = other.modifiedTimeCondition.copy();
		}
		if (other.modifiedByCondition != null) {
			this.modifiedByCondition = other.modifiedByCondition.copy();
		}
		if (other.delCondition != null) {
			this.delCondition = other.delCondition.copy();
		}
		this.setOther(other);
	}
	private void setOther(OffPrizeQuery other){
		if(other.delTimeCondition != null) {
			this.delTimeCondition = other.delTimeCondition.copy();
		}
		if(other.delByCondition != null) {
			this.delByCondition = other.delByCondition.copy();
		}
	}

	@Override
	public QueryWrapper<OffPrizeEntity> toQueryWrapper() {
		QueryWrapper<OffPrizeEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (gradeCondition != null) {
			gradeCondition.toWrapper(wrapper, COL_GRADE);
		}
		if (nameCondition != null) {
			nameCondition.toWrapper(wrapper, COL_NAME);
		}
		if (sumCondition != null) {
			sumCondition.toWrapper(wrapper, COL_SUM);
		}
		if (priceCondition != null) {
			priceCondition.toWrapper(wrapper, COL_PRICE);
		}
		if (imgCondition != null) {
			imgCondition.toWrapper(wrapper, COL_IMG);
		}
		if (statusCondition != null) {
			statusCondition.toWrapper(wrapper, COL_STATUS);
		}
		if (activityIdCondition != null) {
			activityIdCondition.toWrapper(wrapper, COL_ACTIVITY_ID);
		}
		if (skuIdCondition != null) {
			skuIdCondition.toWrapper(wrapper, COL_SKU_ID);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		if (modifiedTimeCondition != null) {
			modifiedTimeCondition.toWrapper(wrapper, COL_MODIFIED_TIME);
		}
		if (modifiedByCondition != null) {
			modifiedByCondition.toWrapper(wrapper, COL_MODIFIED_BY);
		}
		if (delCondition != null) {
			delCondition.toWrapper(wrapper, COL_DEL);
		}
		return getQueryWrapper(wrapper);
	}
	private QueryWrapper<OffPrizeEntity> getQueryWrapper(QueryWrapper<OffPrizeEntity> wrapper){
		if (delTimeCondition != null) {
			delTimeCondition.toWrapper(wrapper, COL_DEL_TIME);
		}
		if (delByCondition != null) {
			delByCondition.toWrapper(wrapper, COL_DEL_BY);
		}
		return wrapper;
	}
	
	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回奖品级别查询条件
	 * 
	 * @return gradeCondition 奖品级别查询条件
	 */
	public Condition<String> grade() {
		this.gradeCondition = new Condition<>();
		return this.gradeCondition;
	}
	
	/**
	 * 获取奖品级别查询条件
	 * 
	 * @return gradeCondition 奖品级别查询条件
	 */
	public Condition<String> getGradeCondition() {
		return gradeCondition;
	}

	/**
	 * 设置奖品级别查询条件
	 * 
	 * @param gradeCondition 奖品级别查询条件
	 */
	public void setGradeCondition(Condition<String> gradeCondition) {
		this.gradeCondition = gradeCondition;
	}

	/**
	 * 构造并返回名称查询条件
	 * 
	 * @return nameCondition 名称查询条件
	 */
	public Condition<String> name() {
		this.nameCondition = new Condition<>();
		return this.nameCondition;
	}
	
	/**
	 * 获取名称查询条件
	 * 
	 * @return nameCondition 名称查询条件
	 */
	public Condition<String> getNameCondition() {
		return nameCondition;
	}

	/**
	 * 设置名称查询条件
	 * 
	 * @param nameCondition 名称查询条件
	 */
	public void setNameCondition(Condition<String> nameCondition) {
		this.nameCondition = nameCondition;
	}

	/**
	 * 构造并返回数量查询条件
	 * 
	 * @return sumCondition 数量查询条件
	 */
	public Condition<Integer> sum() {
		this.sumCondition = new Condition<>();
		return this.sumCondition;
	}
	
	/**
	 * 获取数量查询条件
	 * 
	 * @return sumCondition 数量查询条件
	 */
	public Condition<Integer> getSumCondition() {
		return sumCondition;
	}

	/**
	 * 设置数量查询条件
	 * 
	 * @param sumCondition 数量查询条件
	 */
	public void setSumCondition(Condition<Integer> sumCondition) {
		this.sumCondition = sumCondition;
	}

	/**
	 * 构造并返回价值查询条件
	 * 
	 * @return priceCondition 价值查询条件
	 */
	public Condition<BigDecimal> price() {
		this.priceCondition = new Condition<>();
		return this.priceCondition;
	}
	
	/**
	 * 获取价值查询条件
	 * 
	 * @return priceCondition 价值查询条件
	 */
	public Condition<BigDecimal> getPriceCondition() {
		return priceCondition;
	}

	/**
	 * 设置价值查询条件
	 * 
	 * @param priceCondition 价值查询条件
	 */
	public void setPriceCondition(Condition<BigDecimal> priceCondition) {
		this.priceCondition = priceCondition;
	}

	/**
	 * 构造并返回图片地址查询条件
	 * 
	 * @return imgCondition 图片地址查询条件
	 */
	public Condition<String> img() {
		this.imgCondition = new Condition<>();
		return this.imgCondition;
	}
	
	/**
	 * 获取图片地址查询条件
	 * 
	 * @return imgCondition 图片地址查询条件
	 */
	public Condition<String> getImgCondition() {
		return imgCondition;
	}

	/**
	 * 设置图片地址查询条件
	 * 
	 * @param imgCondition 图片地址查询条件
	 */
	public void setImgCondition(Condition<String> imgCondition) {
		this.imgCondition = imgCondition;
	}

	/**
	 * 构造并返回[枚举]奖品进行状态：0-未开始-NOT_STARTED、1-正在进行-ONGOING、2-已结束-OVER查询条件
	 * 
	 * @return statusCondition [枚举]奖品进行状态：0-未开始-NOT_STARTED、1-正在进行-ONGOING、2-已结束-OVER查询条件
	 */
	public Condition<OffPrizeStatus> status() {
		this.statusCondition = new Condition<>();
		return this.statusCondition;
	}
	
	/**
	 * 获取[枚举]奖品进行状态：0-未开始-NOT_STARTED、1-正在进行-ONGOING、2-已结束-OVER查询条件
	 * 
	 * @return statusCondition [枚举]奖品进行状态：0-未开始-NOT_STARTED、1-正在进行-ONGOING、2-已结束-OVER查询条件
	 */
	public Condition<OffPrizeStatus> getStatusCondition() {
		return statusCondition;
	}

	/**
	 * 设置[枚举]奖品进行状态：0-未开始-NOT_STARTED、1-正在进行-ONGOING、2-已结束-OVER查询条件
	 * 
	 * @param statusCondition [枚举]奖品进行状态：0-未开始-NOT_STARTED、1-正在进行-ONGOING、2-已结束-OVER查询条件
	 */
	public void setStatusCondition(Condition<OffPrizeStatus> statusCondition) {
		this.statusCondition = statusCondition;
	}

	/**
	 * 构造并返回活动Id查询条件
	 * 
	 * @return activityIdCondition 活动Id查询条件
	 */
	public Condition<String> activityId() {
		this.activityIdCondition = new Condition<>();
		return this.activityIdCondition;
	}
	
	/**
	 * 获取活动Id查询条件
	 * 
	 * @return activityIdCondition 活动Id查询条件
	 */
	public Condition<String> getActivityIdCondition() {
		return activityIdCondition;
	}

	/**
	 * 设置活动Id查询条件
	 * 
	 * @param activityIdCondition 活动Id查询条件
	 */
	public void setActivityIdCondition(Condition<String> activityIdCondition) {
		this.activityIdCondition = activityIdCondition;
	}

	/**
	 * 构造并返回商品Id查询条件
	 * 
	 * @return skuIdCondition 商品Id查询条件
	 */
	public Condition<String> skuId() {
		this.skuIdCondition = new Condition<>();
		return this.skuIdCondition;
	}
	
	/**
	 * 获取商品Id查询条件
	 * 
	 * @return skuIdCondition 商品Id查询条件
	 */
	public Condition<String> getSkuIdCondition() {
		return skuIdCondition;
	}

	/**
	 * 设置商品Id查询条件
	 * 
	 * @param skuIdCondition 商品Id查询条件
	 */
	public void setSkuIdCondition(Condition<String> skuIdCondition) {
		this.skuIdCondition = skuIdCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdTimeCondition 查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdByCondition 查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return modifiedTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> modifiedTime() {
		this.modifiedTimeCondition = new Condition<>();
		return this.modifiedTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return modifiedTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getModifiedTimeCondition() {
		return modifiedTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param modifiedTimeCondition 查询条件
	 */
	public void setModifiedTimeCondition(Condition<LocalDateTime> modifiedTimeCondition) {
		this.modifiedTimeCondition = modifiedTimeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return modifiedByCondition 查询条件
	 */
	public Condition<String> modifiedBy() {
		this.modifiedByCondition = new Condition<>();
		return this.modifiedByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return modifiedByCondition 查询条件
	 */
	public Condition<String> getModifiedByCondition() {
		return modifiedByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param modifiedByCondition 查询条件
	 */
	public void setModifiedByCondition(Condition<String> modifiedByCondition) {
		this.modifiedByCondition = modifiedByCondition;
	}

	/**
	 * 构造并返回删除 0-未删除；1-已删除查询条件
	 * 
	 * @return delCondition 删除 0-未删除；1-已删除查询条件
	 */
	public Condition<Boolean> del() {
		this.delCondition = new Condition<>();
		return this.delCondition;
	}
	
	/**
	 * 获取删除 0-未删除；1-已删除查询条件
	 * 
	 * @return delCondition 删除 0-未删除；1-已删除查询条件
	 */
	public Condition<Boolean> getDelCondition() {
		return delCondition;
	}

	/**
	 * 设置删除 0-未删除；1-已删除查询条件
	 * 
	 * @param delCondition 删除 0-未删除；1-已删除查询条件
	 */
	public void setDelCondition(Condition<Boolean> delCondition) {
		this.delCondition = delCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return delTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> delTime() {
		this.delTimeCondition = new Condition<>();
		return this.delTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return delTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getDelTimeCondition() {
		return delTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param delTimeCondition 查询条件
	 */
	public void setDelTimeCondition(Condition<LocalDateTime> delTimeCondition) {
		this.delTimeCondition = delTimeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return delByCondition 查询条件
	 */
	public Condition<String> delBy() {
		this.delByCondition = new Condition<>();
		return this.delByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return delByCondition 查询条件
	 */
	public Condition<String> getDelByCondition() {
		return delByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param delByCondition 查询条件
	 */
	public void setDelByCondition(Condition<String> delByCondition) {
		this.delByCondition = delByCondition;
	}

}
